const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const Time = require('../public/javascripts/time')

const BookContentSchema = new Schema({
    title: {     //章节名
        type: String,
        required: true
    },
    content: {      //内容
        type: String,
    },
    bookid: {     //书id
        type: String
    },
    state: {    //章节状态
        type: Number,
        default: 0
    },
    size: {
        type:Number
    },
    date: {         //创建日期
        type: String,
        default: new Time().getTime()
    },
})

module.exports = Content = mongoose.model("booksContent", BookContentSchema);